package com.gientech.stockSeata.controller;

import com.gientech.stockSeata.dao.StockDao;
import com.gientech.stockSeata.domain.Stock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class stockController {
    @Autowired
    private StockDao stockDao;

    @GetMapping("/addStock")
    public String addStock(){
        Stock s = new Stock();
        s.setProductId(99990001);
        s.setCount(99999999);

        int msg = stockDao.addStock(s);
        System.out.println("msg: " + msg);

        return "";
    }
}
